package ext.tianma.forms.processors;


import java.util.Iterator;
import java.util.List;

import wt.util.WTException;
import wt.vc.Iterated;

import com.ptc.core.components.beans.ObjectBean;
import com.ptc.core.components.forms.FormResult;
import com.ptc.netmarkets.util.beans.NmCommandBean;
import com.ptc.windchill.enterprise.change2.forms.processors.DefaultChangeTaskFormProcessor;

public class CusDefaultChangeTaskFormProcessor extends DefaultChangeTaskFormProcessor{

	@Override
	public FormResult doOperation(NmCommandBean nmcommandbean, List list) throws WTException {
		FormResult formResult  = super.doOperation(nmcommandbean, list);
		System.out.println( "Debug   进入Processor..." );
	      if ((list != null) && (!list.isEmpty())) {
	    	  Iterator iterator = list.iterator();
	    	while( iterator.hasNext() ){
	    		System.out.println( "Debug   进入while..." );
	    		Object object = iterator.next();
	    		if( ( object != null ) && ( object instanceof  ObjectBean  ) ){
	    			System.out.println( "Debug   进入if..." );
	    			ObjectBean objectbean =( ObjectBean )object;
	    			Object objt = objectbean.getObject();
	    			if( ( objt != null ) && ( objt instanceof Iterated ) ){
	    				Iterated iterated  =( Iterated ) objt;
	    				
	    				ChangeNumberUtil.updateChangeItemNumber(iterated);
	    			}
	    		}
	    	}
	      }
		return formResult;	
	}
}
